package com.example.mindadinner.Activity;

import com.aphidmobile.flip.FlipViewController;
import com.example.mindadinner.R;
import com.example.mindadinner.adapter.test.TravelAdapter;
import com.jdp.swipebackLibrary.SwipeBackActivity;

import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class FoodDetailActivity extends SwipeBackActivity {
	private FlipViewController flipView;
	private LayoutInflater lf ;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		lf = LayoutInflater.from(getApplicationContext());
		flipView = new FlipViewController(this);
		flipView.setAnimationBitmapFormat(Bitmap.Config.RGB_565);
//		flipView.setAdapter(new BaseAdapter() {
//
//			@Override
//			public View getView(int position, View convertView, ViewGroup parent) {
//				ViewHolder holder = null;
//				if (convertView == null) {
//					holder = new ViewHolder();
//					convertView = lf.inflate(R.layout.food_detial, null);
//					holder.imageView=(ImageView)convertView.findViewById(R.id.food_image);
//					holder.textView=(TextView)convertView.findViewById(R.id.food_text);
//					convertView.setTag(holder);
//				} else {
//					holder=(ViewHolder)convertView.getTag();
//				}
//
//				return convertView;
//			}
//
//			@Override
//			public long getItemId(int position) {
//				return position;
//			}
//
//			@Override
//			public Object getItem(int position) {
//				return null;
//			}
//
//			@Override
//			public int getCount() {
//				return 20;
//			}
//		});
		 flipView.setAdapter(new TravelAdapter(this));
		setContentView(flipView);
	}

	@Override
	protected void onResume() {
		super.onResume();
		flipView.onResume();
	}

	@Override
	protected void onPause() {
		super.onPause();
		flipView.onPause();
	}

	private static class ViewHolder {
		public ImageView imageView;
		public TextView textView;
	}
}
